package com.victor.system.api;

import com.victor.common.core.constant.SecurityConstants;
import com.victor.common.core.constant.ServiceNameConstants;
import com.victor.common.core.domain.R;
import com.victor.common.entity.system.SysHospital;
import com.victor.common.entity.system.SysThirdKey;
import com.victor.common.response.system.OrgCodeAndOrgName;
import com.victor.system.api.factory.RemoteSysHospitalFallbackFactory;
import feign.Headers;
import net.sf.oval.guard.Post;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(contextId = "remoteSysHospitalService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemoteSysHospitalFallbackFactory.class)
public interface RemoteSysHospitalService {

    @GetMapping("/sysHospital/getRuleSystemType")
    public R<Integer> getRuleSystemType(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysHospital/getOrgInfoByWjw")
    public R<SysHospital> getOrgInfoByWjw(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysHospital/getOrgNameByOrgCode")
    public R<String> getOrgList(@RequestParam("orgCode") String orgCode, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysHospital/getOrgCodeCloseStatus")
    public R<String> getOrgCodeCloseStatus(@RequestParam("orgCode") String orgCode,  @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/sysThirdKey/findList")
    public R<List<SysThirdKey>> findList(@RequestBody SysThirdKey body, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @PostMapping("/sysThirdKey/updateThirdToken")
    public R<Boolean> updateThirdToken(@RequestBody SysThirdKey body, @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysThirdKey/getYCThirdMsg")
    public R<SysThirdKey> getYCThirdMsg(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysHospital/getRegisterNumByOrgCode/{orgCode}")
    public R<String> getRegisterNumByOrgCode(@PathVariable("orgCode")String orgCode,@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    @GetMapping("/sysHospital/getOrgNameAndCommunity")
    public R<List<OrgCodeAndOrgName>> getOrgNameAndCommunity(@RequestHeader(SecurityConstants.FROM_SOURCE) String source);

}
